<template>
  <div>
    {{ value }}
    <button @click="onAdd">+1</button>
  </div>
</template>

<script>
export default {
  props: {
    value: Number,
    idx: Number,
  },
  methods: {
    onAdd () {
      // this.$emit('自定义事件名', ...args);
      this.$emit('add', this.idx);
    },
  },
}
</script>

<style scoped>

</style>